var reg = /^\d{4}-\d{7}$/

var phone = '939-1999393'

console.log(reg.test(phone)); 

var str = '激情和jerry激情'

// var newStr = str.replace('tom','curry')
var newStr = str.replace(/激情|gay/g,'……')

console.log(newStr);